#!/dis/sh.dis
load std
autoload=std

bind -c /dis /dis
bind -a '#w' /dev
bind -c '#splumber' /chan
bind -a '#^' /chan
if {ftest -d '#A'}{
	bind -a '#A' /dev
}

run $home/lib/functions
if {! ftest -f /net/dns}{
	ndb/dns -r
}
if {! ftest -f /net/cs}{
	ndb/cs
}
if {! ftest -f /mnt/factotum/proto}{
	auth/factotum
}

acme-font=/fonts/gb/gb.font
acme-Font=/fonts/gb/gbmono.font

if {ftest -f $home/acme.dump}{
	acme -a -l $home/acme.dump
}

sleep 1
waitid = `{sed '' /prog/*/status | sort -n | grep Acme | sed 1q | sed 's/^ +([0-9]+) +.*/\1/'}
read < /prog/^$waitid^/wait
sleep 2
echo halt > /dev/sysctl
